
#pragma once
#include "stdafx.h"

class CWicStream;

class CLASS_DECLSPEC CWicBitmapEncoder 
{
    //==============================================================================
    // CWicBitmapEncoder
    //==============================================================================
public:
    CWicBitmapEncoder(REFGUID guidContainerFormat, const GUID *pguidVendor = NULL);

    CWicBitmapEncoder(CWicBitmapEncoder const &);
    virtual ~CWicBitmapEncoder(void);
    CWicBitmapEncoder& operator=(CWicBitmapEncoder const &);

    //==============================================================================
    // IWICBitmapEncoder
    //==============================================================================
public:
    virtual HRESULT STDMETHODCALLTYPE Initialize( 
        /* [in] */ CWicStream *pStream,
        /* [in] */ WICBitmapEncoderCacheOption cacheOption);

    virtual HRESULT STDMETHODCALLTYPE GetContainerFormat( 
        /* [out] */ __RPC__out GUID *pguidContainerFormat);

    virtual HRESULT STDMETHODCALLTYPE GetEncoderInfo( 
        /* [out] */ __RPC__deref_out_opt IWICBitmapEncoderInfo **ppIEncoderInfo);

    virtual HRESULT STDMETHODCALLTYPE SetColorContexts( 
        /* [in] */ UINT cCount,
        /* [size_is][in] */ __RPC__in_ecount_full(cCount) IWICColorContext **ppIColorContext);

    virtual HRESULT STDMETHODCALLTYPE SetPalette( 
        /* [in] */ IWICPalette *pIPalette);

    virtual HRESULT STDMETHODCALLTYPE SetThumbnail( 
        /* [in] */ IWICBitmapSource *pIThumbnail);

    virtual HRESULT STDMETHODCALLTYPE SetPreview( 
        /* [in] */ IWICBitmapSource *pIPreview);

    virtual HRESULT STDMETHODCALLTYPE CreateNewFrame( 
        /* [out] */ __RPC__deref_out_opt IWICBitmapFrameEncode **ppIFrameEncode,
        /* [unique][out][in] */ __RPC__deref_opt_inout_opt IPropertyBag2 **ppIEncoderOptions);

    virtual HRESULT STDMETHODCALLTYPE Commit( void);

    virtual HRESULT STDMETHODCALLTYPE GetMetadataQueryWriter( 
        /* [out] */ __RPC__deref_out_opt IWICMetadataQueryWriter **ppIMetadataQueryWriter);


private:
    IWICBitmapEncoder  *m_pIWICBitmapEncoder;
};

